import { Schema } from "mongoose";

const videoSchema = new Schema({
  title: { type: String, required: true },
  description: { type: String, required: false },
  vodId: { type: String, required: true },
  vodURL: { type: String, required: false },
  user: { type: Schema.Types.ObjectId, required: true, ref: "User" },
  cover: { type: String, required: false },
  playCount: { type: Number, default: 0, min: 0 },
  likeCount: { type: Number, default: 0, min: 0 },
  commentCount: { type: Number, default: 0, min: 0 },
  collectCount: { type: Number, default: 0, min: 0 },
  createTime: { type: Date, default: Date.now },
  updateTime: { type: Date, default: Date.now },
});

export default videoSchema;
